package org.mainlove.project.web.web.service;

import java.util.HashMap;
import java.util.Map;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.json.JSONObject;
import org.mainlove.project.web.framework.annotation.Method;
import org.mainlove.project.web.framework.annotation.Service;
import org.mainlove.project.web.framework.result.ActionForward;
import org.mainlove.project.web.framework.result.OutWriteActionForward;
import org.mainlove.project.web.framework.result.TemplateActionForward;
import org.mainlove.project.web.framework.util.HttpMethod;
import org.mainlove.project.web.framework.util.TemplateConfiguration;

@Service(name = "test1")
@SuppressWarnings({ "rawtypes", "unchecked" })
public class Test1Service {

	@Method(name = "testFoo", method = HttpMethod.GET)
	public ActionForward testFoo(HttpServletRequest request, HttpServletResponse response, JSONObject
			jsonObject)
			throws Exception {

		Map rootMap = new HashMap();
		rootMap.put("testFoo", "-------------------testFoo:success---------------------");

		return new TemplateActionForward(TemplateConfiguration.getTemplate("testFoo.ftl"), rootMap);
	}

	@Method(name = "testTxx", method = HttpMethod.POST)
	public ActionForward testTxx(HttpServletRequest request, HttpServletResponse response, JSONObject jsonObject) {

		return new OutWriteActionForward("-------------------testTxx:success---------------------");
	}

}
